<template>

     <div class='list'>
		  <div class='top'>请填写真实姓名和手机号码</div>
		  <div class='center'>*发放奖励时，系统会验证您的真实姓名和微信实名是否一致，如果不一致将会导致奖励无法发放！</div>
		 
		      <group>

			      <x-input  placeholder="真实姓名" v-model="truename">
			         <i slot="label" class="iconfont icon-wo"> </i>
			      </x-input>

			      <x-input  is-type="china-mobile" placeholder="手机号码" v-model="mobile">
			        <i slot="label" class="iconfont icon-shoujihao"> </i>
			      </x-input>
  
			  </group>

          
		    <XButton @click.native="toModify">去修改</XButton>
		  
     </div>

</template>

<script>
   

   import { XButton,XInput,base64 } from 'vux'


   export default {
	  components: {
	    XButton,
	    XInput,
	    base64
	  
   },
   
    data () {
	    return {
	      
	      mobile:'',
	      truename:'',
	      access_token:''
	
	    }
	},
    
	methods:{
       
        toModify(){
       	  console.log(111);
       	  this.$router.push({ path: '/modify',name:'modify',params:{mobile:this.mobile}});
        },
       
       
        //获取详情
	    getDetail(){
	    	
	    	this.$store.commit('updateLoadingStatus',true);
	    	
	    	this.$http.get(this.$store.state.api + 'userdd/userinfo&access_token=' + this.access_token)
		    .then((response) => {
		    		
		    console.log(response)
				
				if(response.body.code == 0) {
					
					this.mobile = response.body.data.mobile,
					this.truename = response.body.data.truename
					
				} else {
					
				}
					
				
			this.$store.commit('updateLoadingStatus',false);		
				
			}, (response) => {
                 
                 
			});
	    },
       
       //获取地址栏信息
		getUrlStr(name){
	      let reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)","i");
	      if(reg.test(window.location.href)){
	        return unescape(RegExp.$2.replace(/\+/g," "))
	      }
	      return undefined
	    },
	    
	},
	
	
	mounted() {
		
		var access_token = this.getUrlStr('access_token');
           var parentId = this.getUrlStr('parent_id');
           
            if(parentId == undefined){
              parentId = 0;
           }
           
           var uid = this.getUrlStr('uid');
           
           if(parentId.toString().indexOf('?') > 0){
           	 parentId = parentId.split('?')[0];
           }
           
           var locurl = location.href;
           locurl = base64.encode(locurl.split('?')[0]);
           
       
           if(access_token != undefined){
         
              localStorage.setItem("access_token",access_token); 
              localStorage.setItem("parent_id",this.getUrlStr('uid'));


           }
           
            if(localStorage.getItem('access_token') != null){
         
              this.$root.registerjudge();
              this.$root.getShare();
              
            }else{
            	
        	  this.$root.gotoWechat(locurl,parentId);
            }
           
    	   this.access_token = localStorage.getItem('access_token');

        this.getDetail();

    }
	  
   }

</script>

<style>
.list{
  padding: 1.875rem 2rem
}

.top{
  text-align: center;
  font-size: 1.15rem;
  font-weight: bold;
  margin-bottom: 1.5625rem;
}

.center{
  font-size: 0.89rem;
  margin-bottom: 10px;
  color: #949293;
  margin: 0 0.3rem;
}

.weui-input{
    
   font-size: 0.9rem !important;
   
}

.list button{
	font-size: 1.2rem;
}

.inputBox{
  /*background: #E4E4E4;
  padding: 2px;
  /*margin-bottom: 30rpx;*/
  border-bottom: 1px solid #888888;
  align-items: center;
}

.inputBox text{
  /*font-size: 50rpx;*/
  /*margin-right: 20rpx*/
}

.iconfont{
  font-size: 15px;
  margin-right: 5px;
}

.list button{
  background: #FF9913;
  color: #fff;
  margin-top: 20px;
  font-size: 
}
</style>